package qc.module.ehs.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import qc.common.core.exception.QCPromptException;
import qc.module.ehs.dto.camera.CameraDto;
import qc.module.ehs.dto.camera.CameraQueryConditionDto;
import qc.module.ehs.service.EhsCameraInfoService;

import java.util.List;

/**
 * CameraController
 *
 * @author QuCheng Tech
 * @since 2025/6/24
 */
@RestController
@RequestMapping("/camera")
public class CameraController {

    @Autowired
    private EhsCameraInfoService service;

    /**
     * 查询摄像头信息
     *
     * @param condition 查询条件
     * @return java.util.List<qc.module.ehs.dto.camera.CameraDto>
     * @author QuCheng Tech
     * @since 2025/6/24
     */
    @RequestMapping(value = "/query", method = {RequestMethod.GET, RequestMethod.POST})
    public List<CameraDto> query(@RequestBody CameraQueryConditionDto condition) throws QCPromptException {
        return service.query(condition);
    }
}
